#ifndef SNAKE_H
#define SNAKE_H

#include <QVector>
#include <QPoint>
#include <QRect>

#define LEFT    0
#define RIGHT   1
#define UP      2
#define DOWN    3

class Snake
{

public:
    Snake(QRect w, int cl);
    void born(QVector<QPoint> b);
    bool moveLeft();
    bool moveRight();
    bool moveUp();
    bool moveDown();
    QPoint getHead();
    void updateHead();
    QVector<QPoint>& getBody();
    bool growLeft();
    bool growRight();
    bool growUp();
    bool growDown();
    bool isValidEat(QPoint eat);

private:
    QVector<QPoint> body;
    QRect wall;
    QPoint head;
    int cellLenght;

    bool hasHeadCollision();
};

#endif // SNAKE_H
